﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using Microsoft.AspNetCore.Http;

//namespace ExpressManagement.Areas.BackSys.ServiceTools
//{
//    public class MyCookie
//    {
//        /// <summary>
//        /// 写cookie
//        /// </summary>
//        /// <param name="strName"></param>
//        /// <param name="strValue"></param>
//        public static void WriteCookie(string strName, string strValue)
//        {
//            HttpCookie cookie = HttpContext.Request.Cookies[strName];
//            if (cookie == null)
//            {
//                cookie = new HttpCookie(strName);
//            }
//            cookie.Value = strValue;
//            HttpContext.Current.Response.AppendCookie(cookie);
//        }
//        /// <summary>
//        /// 读取cookie
//        /// </summary>
//        /// <param name="strName"></param>
//        /// <returns></returns>
//        public static string GetCookie(string strName)
//        {
//            if (HttpContext.Request.Cookies != null && HttpContext.Request.Cookies[strName] != null)
//            {
//                return HttpContext.Request.Cookies[strName].Value.ToString();
//            }
//            return "";
//        }
//        /// <summary>
//        /// 删除cookie
//        /// </summary>
//        /// <param name="CookiesName"></param>
//        public static void RemoveCookie(string CookiesName)
//        {
//            HttpCookie objCookie = new HttpCookie(CookiesName.Trim());
//            objCookie.Expires = DateTime.Now.AddYears(0);
//            HttpContext.Current.Response.Cookies.Add(objCookie);
//        }
//    }
//}